package com.ymatou.iapi.trading.sellerquery2.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.commons.collections.CollectionUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.trading.operate.parameter.BargainGroupService;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderResp;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderService;
import com.ymatou.iapi.trading.operate.parameter.po.OrderInfoSubPo;
import com.ymatou.iapi.trading.operate.parameter.req.BizVo;
import com.ymatou.iapi.trading.operate.testcase.Ts_ChangeOrderBizStatus;
import com.ymatou.iapi.trading.ordersync.service.SyncVerifyService;
import com.ymatou.iapi.trading.sellerquery2.parameter.sp.Sp_GetSellerOrderList_v2;
import com.ymatou.iapi.trading.sellerquery2.parameter.sp.Sp_GetSellerOrdersByOrderIds_v1;
import com.ymatou.iapi.trading.sellerquery2.parameter.sp.Sp_GetSellerOrdersByOrderIds_v1.OrderTradingId;
import com.ymatou.iapi.trading.sellerquery2.parameter.vo.SubProductInfo;
import com.ymatou.query.seller.trading.api.parameter.GetSellerMainOrderListBean;
import com.ymatou.query.seller.trading.api.parameter.GetSellerMainOrderListResponse;
import com.ymatou.query.seller.trading.api.parameter.OrderEntities;
import com.ymatou.query.seller.trading.api.parameter.OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.PackageDeliveryDomesticStatusFilter;
import com.ymatou.query.seller.trading.api.parameter.RequestCovertor;
import com.ymatou.query.seller.trading.api.parameter.SellerMainOrderListQueryModel;
import com.ymatou.query.seller.trading.api.parameter.Ymt_O_OrderNote;
import com.ymatou.query.seller.trading.api.parameter.Ymt_Order;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderInfo;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderState;
import com.ymatou.query.seller.trading.api.parameter.Ymt_OrderSummary;
import com.ymatou.query.seller.trading.api.service.OrderCreate;
import com.ymatou.query.trading.api.parameter.OrderConverter;
import com.ymt.base.YmatouEasyCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P2;
import com.ymt.utils.tag.P3;
import com.ymttest.business.service.OrderCallService;
import com.ymttest.common.entitie.BillInfo;
import com.ymttest.common.entitie.C2COrderInfo;
import com.ymttest.common.entitie.OrderItemInfo;
import com.ymttest.common.enums.OrderStatusEnum;
import com.ymttest.common.order.sellerquery2.Common;
import com.ymttest.database.model.ProductPromotion;
import com.ymttest.database.model.Ymt_Bill;
import com.ymttest.database.model.Ymt_CreditDetail;
import com.ymttest.database.model.Ymt_OrderExt;
import com.ymttest.database.model.Ymt_OrderPostPay;
import com.ymttest.database.model.Ymt_OrderToBill;
import com.ymttest.database.model.Ymt_Order_Frozen;
import com.ymttest.database.model.Ymt_TradingItem;
import com.ymttest.database.sqlwapper.DefaultWapper;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.YMTDateUtil;

/**
 * @date 2016-06-28
 * @author songyefeng
 * @desc 商家后台订单列表
 */
@TestSuite
public class Ts_GetSellerMainOrderList {

	private static GetSellerMainOrderListBean request;
	// private static
	// com.ymatou.query.seller.trading.api.service.GetSellerMainOrderListCall
	// call;
	private static com.ymatou.iapi.trading.sellerquery2.service.GetSellerMainOrderListCall call;
	private static final String DEFAULTCSHARPDATEIME = "0001-01-01 00:00:00";

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取商家订单列表.开放: 多商品 and M端商品 and 主单号");
	}

	@Before
	public void caseUp() {
		request = new GetSellerMainOrderListBean();
		// call = new
		// com.ymatou.query.seller.trading.api.service.GetSellerMainOrderListCall();
		call = new com.ymatou.iapi.trading.sellerquery2.service.GetSellerMainOrderListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	private void verify() {
		GetSellerMainOrderListResponse expectedResponse = new GetSellerMainOrderListResponse();
		ConstructExpectedResponse(expectedResponse);
		GetSellerMainOrderListResponse actualResponse = call
				.getSellerMainOrderListResponse();
		DataUtil.verify(expectedResponse.getAllRecordCount(),
				actualResponse.getAllRecordCount(), "验证AllRecordCount");
		List<OrderInfo> expects = expectedResponse.getOrderInfoList();
		List<OrderInfo> actuals = actualResponse.getOrderInfoList();
		DataUtil.verify(expects.size(), actuals.size(), "验证OrderInfoList的长度");
		for (int i = 0; i < expects.size(); i++) {
			OrderInfo exp = expects.get(i);
			int expOid = exp.getOrderId();
			boolean exists = actuals.stream().anyMatch(
					x -> x.getOrderId() == expOid);
			DataUtil.verify(true, exists, "验证期望的OrderId：" + expOid
					+ "在实际结果中是否出现");
			if (exists) {
				DataUtil.verify(exp.getOrderId(), actuals.get(i).getOrderId(),
						"验证OrderId的排序");
				OrderInfo act = actuals.stream()
						.filter(x -> x.getOrderId() == expOid)
						.collect(Collectors.toList()).get(0);
				DataUtil.verify(exp.getUserId(), act.getUserId(), "验证OrderId["
						+ expOid + "]的UserId");
				DataUtil.verify(exp.getTotalRefundThirdPartyDiscount(),
						act.getTotalRefundThirdPartyDiscount(), "验证OrderId["
								+ expOid + "]的TotalRefundThirdPartyDiscount");
				DataUtil.verify(exp.getBuyerId(), act.getBuyerId(),
						"验证OrderId[" + expOid + "]的BuyerId");
				DataUtil.verifyDateEquals(exp.getAddTime(), act.getAddTime(),
						"验证OrderId[" + expOid + "]的AddTime");
				DataUtil.verifyDecimalEquals(exp.getOrderPrice(),
						act.getOrderPrice(), "验证OrderId[" + expOid
								+ "]的OrderPrice");
				DataUtil.verifyDecimalEquals(exp.getOrderDiscount(),
						act.getOrderDiscount(), "验证OrderId[" + expOid
								+ "]的OrderDiscount");
				DataUtil.verifyDecimalEquals(exp.getFreight(),
						act.getFreight(), "验证OrderId[" + expOid + "]的Freight");
				DataUtil.verifyDecimalEquals(exp.getDiscount(),
						act.getDiscount(), "验证OrderId[" + expOid + "]的Discount");
				// DataUtil.verify(exp.getTradingId(), act.getTradingId(),
				// "验证OrderId[" + expOid + "]的TradingId");
				DataUtil.verify(
						DataUtil.Integerr.GetValueOrDefault(exp.getOperate()),
						DataUtil.Integerr.GetValueOrDefault(act.getOperate()),
						"验证OrderId[" + expOid + "]的Operate");
				// DataUtil.verifyDateEquals(exp.getOperateExpireTime(),
				// act.getOperateExpireTime(), "验证OrderId[" + expOid
				// + "]的OperateExpireTime");
				DataUtil.verify(exp.getAddress(), act.getAddress(),
						"验证OrderId[" + expOid + "]的Address");
				DataUtil.verify(exp.getPostCode(), act.getPostCode(),
						"验证OrderId[" + expOid + "]的PostCode");
				DataUtil.verify(exp.getReceivePerson(), act.getReceivePerson(),
						"验证OrderId[" + expOid + "]的ReceivePerson");
				DataUtil.verify(exp.getPhone(), act.getPhone(), "验证OrderId["
						+ expOid + "]的Phone");
				DataUtil.verify(exp.getTelephone(), act.getTelephone(),
						"验证OrderId[" + expOid + "]的Telephone");
				// DataUtil.verify(exp.getQQ(), act.getQQ(), "验证OrderId[" +
				// expOid + "]的QQ");
				DataUtil.verify(exp.getEmail(), act.getEmail(), "验证OrderId["
						+ expOid + "]的Email");
				DataUtil.verify(exp.getLeaveWord(), act.getLeaveWord(),
						"验证OrderId[" + expOid + "]的LeaveWord");
				DataUtil.verify(DataUtil.Integerr.GetValueOrDefault(exp
						.getUnfreezeStatus()), DataUtil.Integerr
						.GetValueOrDefault(act.getUnfreezeStatus()),
						"验证OrderId[" + expOid + "]的UnfreezeStatus");
				DataUtil.verifyDateEquals(exp.getDispathTime(),
						act.getDispathTime(), "验证OrderId[" + expOid
								+ "]的DispathTime");
				DataUtil.verify(exp.getTopicId(), act.getTopicId(),
						"验证OrderId[" + expOid + "]的TopicId");
				DataUtil.verify(exp.getTitle(), act.getTitle(), "验证OrderId["
						+ expOid + "]的Title");
				DataUtil.verify(exp.getReplyTopicWhenOrderPaid(),
						act.getReplyTopicWhenOrderPaid(), "验证OrderId[" + expOid
								+ "]的ReplyTopicWhenOrderPaid");
				DataUtil.verify(true, act.isPaidInFull(), "验证OrderId[" + expOid
						+ "]的PaidInFull");
				DataUtil.verifyDecimalEquals(exp.getUseGiftAmount(),
						act.getUseGiftAmount(), "验证OrderId[" + expOid
								+ "]的UseGiftAmount");
				DataUtil.verify(exp.getCouponCode(), act.getCouponCode(),
						"验证OrderId[" + expOid + "]的CouponCode");
				DataUtil.verifyDecimalEquals(DataUtil.BigDecimall
						.GetValueOrDefault(exp.getCouponValue()),
						DataUtil.BigDecimall.GetValueOrDefault(act
								.getCouponValue()), "验证OrderId[" + expOid
								+ "]的CouponValue");
				// DataUtil.verify(DataUtil.Integerr.GetValueOrDefault(exp.getCouponType()),
				// DataUtil.Integerr.GetValueOrDefault(act.getCouponType()),
				// "验证OrderId[" + expOid + "]的CouponType");
				DataUtil.verifyDateEquals(exp.getPaidTime(), act.getPaidTime(),
						"验证OrderId[" + expOid + "]的PaidTime");
				DataUtil.verifyDateEquals(exp.getApplyPostPayTime(),
						act.getApplyPostPayTime(), "验证OrderId[" + expOid
								+ "]的ApplyPostPayTime");
				DataUtil.verifyDateEquals(exp.getPostPaidTime(),
						act.getPostPaidTime(), "验证OrderId[" + expOid
								+ "]的PostPaidTime");
				DataUtil.verifyDateEquals(exp.getAcceptTime(),
						act.getAcceptTime(), "验证OrderId[" + expOid
								+ "]的AcceptTime");
				DataUtil.verifyDateEquals(exp.getConfirmedTime(),
						act.getConfirmedTime(), "验证OrderId[" + expOid
								+ "]的ConfirmedTime");
				DataUtil.verifyDateEquals(exp.getChangeAddressTime(),
						act.getChangeAddressTime(), "验证OrderId[" + expOid
								+ "]的ChangeAddressTime");
				// DataUtil.verify(exp.getDistributor(), act.getDistributor(),
				// "验证OrderId[" + expOid + "]的Distributor");
				DataUtil.verify(exp.getThirdOrderId(), act.getThirdOrderId(),
						"验证OrderId[" + expOid + "]的ThirdOrderId");
				DataUtil.verify(exp.getType(), act.getType(), "验证OrderId["
						+ expOid + "]的Type");
				// DataUtil.verifyDecimalEquals(exp.getOldFreight(),
				// act.getOldFreight(), "验证OrderId[" + expOid
				// + "]的OldFreight");
				// DataUtil.verifyDateEquals(exp.getDiscountTime(),
				// act.getDiscountTime(), "验证OrderId[" + expOid
				// + "]的DiscountTime");
				// DataUtil.verifyDecimalEquals(exp.getOldDiscount(),
				// act.getOldDiscount(), "验证OrderId[" + expOid
				// + "]的OldDiscount");
				DataUtil.verifyDecimalEquals(exp.getAutoCancelOrderHours(),
						act.getAutoCancelOrderHours(), "验证OrderId[" + expOid
								+ "]的AutoCancelOrderHours");
				DataUtil.verifyDateEquals(exp.getCancelTime(),
						act.getCancelTime(), "验证OrderId[" + expOid
								+ "]的CancelTime");
				// DataUtil.verify(exp.isShangouOrder(), act.isShangouOrder(),
				// "验证OrderId[" + expOid + "]的ShangouOrder");
				DataUtil.verify(exp.getBuyerLoginId(), act.getBuyerLoginId(),
						"验证OrderId[" + expOid + "]的BuyerLoginId");
				// DataUtil.verify(exp.getBuyerLoginEmail(),
				// act.getBuyerLoginEmail(), "验证OrderId[" + expOid
				// + "]的BuyerLoginEmail");
				DataUtil.verify(exp.getSellerLoginId(), act.getSellerLoginId(),
						"验证OrderId[" + expOid + "]的SellerLoginId");
				// DataUtil.verify(exp.getSellerLoginEmail(),
				// act.getSellerLoginEmail(), "验证OrderId[" + expOid
				// + "]的SellerLoginEmail");
				DataUtil.verify(exp.getIsMerchant(), act.getIsMerchant(),
						"验证OrderId[" + expOid + "]的IsMerchant");
				DataUtil.verify(exp.getBuyerNickName(), act.getBuyerNickName(),
						"验证OrderId[" + expOid + "]的BuyerNickName");
				DataUtil.verifyDecimalEquals(exp.getTotalPrice(),
						act.getTotalPrice(), "验证OrderId[" + expOid
								+ "]的TotalPrice");
				DataUtil.verifyDecimalEquals(exp.getUseFreeCardAmount(),
						act.getUseFreeCardAmount(), "验证OrderId[" + expOid
								+ "]的UseFreeCardAmount");
				// DataUtil.verifyDateEquals(exp.getAutoReceiveTime(),
				// act.getAutoReceiveTime(), "验证OrderId[" + expOid
				// + "]的AutoReceiveTime");
				DataUtil.verify(exp.isIsAutoReceiveEnabled(),
						act.isIsAutoReceiveEnabled(), "验证OrderId[" + expOid
								+ "]的IsAutoReceiveEnabled");
				DataUtil.verify(exp.isCredited(), act.isCredited(),
						"验证OrderId[" + expOid + "]的Credited");
				DataUtil.verify(exp.getCreditId(), act.getCreditId(),
						"验证OrderId[" + expOid + "]的CreditId");
				DataUtil.verify(exp.getCreditUserId(), act.getCreditUserId(),
						"验证OrderId[" + expOid + "]的CreditUserId");
				DataUtil.verify(exp.getCreditServiceRange(),
						act.getCreditServiceRange(), "验证OrderId[" + expOid
								+ "]的CreditServiceRange");
				DataUtil.verify(exp.getCreditUniformityRange(),
						act.getCreditUniformityRange(), "验证OrderId[" + expOid
								+ "]的CreditUniformityRange");
				DataUtil.verify(exp.getCreditScoreRange(),
						act.getCreditScoreRange(), "验证OrderId[" + expOid
								+ "]的CreditScoreRange");
				DataUtil.verify(exp.getCreditDescript(),
						act.getCreditDescript(), "验证OrderId[" + expOid
								+ "]的CreditDescript");
				DataUtil.verifyDateEquals(
						DataUtil.Stringg.getValueOrDefault(
								exp.getCreditAddTime(), DEFAULTCSHARPDATEIME),
						act.getCreditAddTime(), "验证OrderId[" + expOid
								+ "]的CreditAddTime");
				DataUtil.verifyDateEquals(DataUtil.Stringg.getValueOrDefault(
						exp.getCreditUpdateTime(), DEFAULTCSHARPDATEIME), act
						.getCreditUpdateTime(), "验证OrderId[" + expOid
						+ "]的CreditUpdateTime");
				DataUtil.verifyDateEquals(exp.getCreditSellerReply(),
						act.getCreditSellerReply(), "验证OrderId[" + expOid
								+ "]的CreditSellerReply");
				DataUtil.verifyDateEquals(DataUtil.Stringg.getValueOrDefault(
						exp.getCreditSellerReplyUpdateTime(),
						DEFAULTCSHARPDATEIME), act
						.getCreditSellerReplyUpdateTime(), "验证OrderId["
						+ expOid + "]的CreditSellerReplyUpdateTime");
				DataUtil.verify(exp.getSellerNote(), act.getSellerNote(),
						"验证OrderId[" + expOid + "]的SellerNote");
				DataUtil.verify(exp.getLogisticsType(), act.getLogisticsType(),
						"验证OrderId[" + expOid + "]的LogisticsType");
				DataUtil.verify(exp.getStockStatus(), act.getStockStatus(),
						"验证OrderId[" + expOid + "]的StockStatus");
				//				 DataUtil.verify(exp.isDelayReceiveFrozened(),
				//				 act.isDelayReceiveFrozened(), "验证OrderId[" + expOid
				//				 + "]的DelayReceiveFrozened"); //先不验证，数据没有同步到mongo
				DataUtil.verifyDateEquals(exp.getDelayReceiveFrozenTime(),
						act.getDelayReceiveFrozenTime(), "验证OrderId[" + expOid
								+ "]的DelayReceiveFrozenTime");
				DataUtil.verifyDateEquals(exp.getDelayReceiveUpdateTime(),
						act.getDelayReceiveUpdateTime(), "验证OrderId[" + expOid
								+ "]的DelayReceiveUpdateTime");
				// DataUtil.verifyDateEquals(exp.getDelayReceiveAddTime(),
				// act.getDelayReceiveAddTime(), "验证OrderId["
				// + expOid + "]的DelayReceiveAddTime");
				DataUtil.verify(exp.getDelayReceiveUserId(),
						act.getDelayReceiveUserId(), "验证OrderId[" + expOid
								+ "]的DelayReceiveUserId");
				DataUtil.verifyDateEquals(exp.getDispatchTime(),
						act.getDispatchTime(), "验证OrderId[" + expOid
								+ "]的DispatchTime");
				DataUtil.verify(exp.isFrozen(), act.isFrozen(), "验证OrderId["
						+ expOid + "]的Frozen");
				DataUtil.verifyDecimalEquals(exp.getRefund(), act.getRefund(),
						"验证OrderId[" + expOid + "]的Refund");
				DataUtil.verifyDecimalEquals(exp.getNeedPostPay(),
						act.getNeedPostPay(), "验证OrderId[" + expOid
								+ "]的NeedPostPay");
				DataUtil.verifyDecimalEquals(exp.getRealPay(),
						act.getRealPay(), "验证OrderId[" + expOid + "]的RealPay");
				DataUtil.verifyDecimalEquals(exp.getRealPaidAmountOfGift(),
						act.getRealPaidAmountOfGift(), "验证OrderId[" + expOid
								+ "]的RealPaidAmountOfGift");
				DataUtil.verifyDecimalEquals(exp.getNeedPrePayAmountOfCash(),
						act.getNeedPrePayAmountOfCash(), "验证OrderId[" + expOid
								+ "]的NeedPrePayAmountOfCash");
				DataUtil.verifyDecimalEquals(exp.getRealPostPay(),
						act.getRealPostPay(), "验证OrderId[" + expOid
								+ "]的RealPostPay");
				DataUtil.verifyDecimalEquals(exp.getPostPaidAmountOfGift(),
						act.getPostPaidAmountOfGift(), "验证OrderId[" + expOid
								+ "]的PostPaidAmountOfGift");
				DataUtil.verifyDecimalEquals(exp.getPostPaidAmountOfCoupon(),
						act.getPostPaidAmountOfCoupon(), "验证OrderId[" + expOid
								+ "]的PostPaidAmountOfCoupon");
				DataUtil.verifyDecimalEquals(exp.getFirstPay(),
						act.getFirstPay(), "验证OrderId[" + expOid + "]的FirstPay");
				DataUtil.verify(exp.getPlatformEnum(), act.getPlatformEnum(),
						"验证OrderId[" + expOid + "]的PlatformEnum");
				DataUtil.verifyDecimalEquals(exp.getRealPaidAmountOfCash(),
						act.getRealPaidAmountOfCash(), "验证OrderId[" + expOid
								+ "]的RealPaidAmountOfCash");
				DataUtil.verify(exp.isIsShippedByXlobo(),
						act.isIsShippedByXlobo(), "验证OrderId[" + expOid
								+ "]的IsShippedByXlobo");
				DataUtil.verify(exp.getThirdPartyRefundStatus(),
						act.getThirdPartyRefundStatus(), "验证OrderId[" + expOid
								+ "]的ThirdPartyRefundStatus");
				DataUtil.verifyDecimalEquals(exp.getPaidAmountOfFreeCard(),
						act.getPaidAmountOfFreeCard(), "验证OrderId[" + expOid
								+ "]的PaidAmountOfFreeCard");
				// DataUtil.verifyDecimalEquals(exp.getPaidAmountOfCoupon(),
				// act.getPaidAmountOfCoupon(), "验证OrderId["
				// + expOid + "]的PaidAmountOfCoupon");
				// DataUtil.verify(exp.isSupportLocalRefund(),
				// act.isSupportLocalRefund(), "验证OrderId[" + expOid
				// + "]的SupportLocalRefund");
				DataUtil.verifyDateEquals(exp.getLocalRefundApplyTime(),
						act.getLocalRefundApplyTime(), "验证OrderId[" + expOid
								+ "]的LocalRefundApplyTime");
				DataUtil.verify(exp.getRiskVerifiedStatus(),
						act.getRiskVerifiedStatus(), "验证OrderId[" + expOid
								+ "]的RiskVerifiedStatus");
				DataUtil.verifyDecimalEquals(exp.getSellerCouponAmount(),
						act.getSellerCouponAmount(), "验证OrderId[" + expOid
								+ "]的SellerCouponAmount");
				DataUtil.verify(exp.getSalesRefundStatus(),
						act.getSalesRefundStatus(), "验证OrderId[" + expOid
								+ "]的SalesRefundStatus");
				DataUtil.verifyDecimalEquals(exp.getTotalSalesRefundAmount(),
						act.getTotalSalesRefundAmount(), "验证OrderId[" + expOid
								+ "]的TotalSalesRefundAmount");
				DataUtil.verifyDecimalEquals(
						exp.getRealSettlementAmountOfCoupon(),
						act.getRealSettlementAmountOfCoupon(), "验证OrderId["
								+ expOid + "]的RealSettlementAmountOfCoupon");
				DataUtil.verifyDecimalEquals(exp.getTotalPriceChange(),
						act.getTotalPriceChange(), "验证OrderId[" + expOid
								+ "]的TotalPriceChange");
				DataUtil.verify(DataUtil.Booleann.GetValueOrDefault(exp
						.getPackageDelivery_DomesticDelivered()),
						DataUtil.Booleann.GetValueOrDefault(act
								.getPackageDelivery_DomesticDelivered()),
						"验证OrderId[" + expOid
								+ "]的PackageDelivery_DomesticDelivered");
				// DataUtil.verify(exp.getCancelReason(), act.getCancelReason(),
				// "验证OrderId[" + expOid + "]的CancelReason");
				DataUtil.verify(exp.isNeedUploadIdCard(),
						act.isNeedUploadIdCard(), "验证OrderId[" + expOid
								+ "]的NeedUploadIdCard");
				//				DataUtil.verify(exp.isHaveUploadedIdCard(), act.isHaveUploadedIdCard(), "验证OrderId[" + expOid
				//								+ "]的HaveUploadedIdCard");
				DataUtil.verify(exp.getSellerCouponCode(),
						act.getSellerCouponCode(), "验证OrderId[" + expOid
								+ "]的SellerCouponCode");
				DataUtil.verify(exp.getYmtCouponCode(), act.getYmtCouponCode(),
						"验证OrderId[" + expOid + "]的YmtCouponCode");
				DataUtil.verifyDecimalEquals(exp.getYmtCouponAmount(),
						act.getYmtCouponAmount(), "验证OrderId[" + expOid
								+ "]的YmtCouponAmount");
				DataUtil.verifyDecimalEquals(exp.getPaidAmountOfYmtCoupon(),
						act.getPaidAmountOfYmtCoupon(), "验证OrderId[" + expOid
								+ "]的PaidAmountOfYmtCoupon");
				DataUtil.verifyDecimalEquals(exp.getPayableAmount(),
						act.getPayableAmount(), "验证OrderId[" + expOid
								+ "]的PayableAmount");
				DataUtil.verify(exp.getMainOrderId(), act.getMainOrderId(),
						"验证OrderId[" + expOid + "]的MainOrderId");
				DataUtil.verify(exp.getRemarkLevel(), act.getRemarkLevel(),
						"验证OrderId[" + expOid + "]的RemarkLevel");
				DataUtil.verifyDecimalEquals(exp.getPromotionReducedAmount(),
						act.getPromotionReducedAmount(), "验证OrderId[" + expOid
								+ "]的PromotionReducedAmount");
				DataUtil.verify(DataUtil.Booleann.GetValueOrDefault(exp
						.getIsNewSellerOrder()), DataUtil.Booleann
						.GetValueOrDefault(act.getIsNewSellerOrder()),
						"验证OrderId[" + expOid + "]的IsNewSellerOrder");
				DataUtil.verify(DataUtil.Booleann.GetValueOrDefault(exp
						.getIsNewCustomerOrder()), DataUtil.Booleann
						.GetValueOrDefault(act.getIsNewCustomerOrder()),
						"验证OrderId[" + expOid + "]的IsNewCustomerOrder");
				// Logger.comment("开始验证OrderId[" + expOid + "]订单的BillCodeList");
				// if (DataUtil.isNullOrEmpty(exp.getBillCodeList())) {
				// DataUtil.verify(true,
				// DataUtil.isNullOrEmpty(act.getBillCodeList()), "验证验证OrderId["
				// + expOid + "]订单的BillCodeList==null或者是空列表");
				// } else {
				// boolean billCodeListHasValue =
				// !DataUtil.isNullOrEmpty(act.getBillCodeList());
				// DataUtil.verify(true, billCodeListHasValue, "验证验证OrderId[" +
				// expOid + "]订单的BillCodeList!=null且不是空列表");
				// if(billCodeListHasValue){
				// DataUtil.verify(exp.getBillCodeList().size(),
				// act.getBillCodeList().size(), "验证验证OrderId[" + expOid
				// + "]订单的BillCodeList的size()");
				// for (String expect : exp.getBillCodeList()) {
				// DataUtil.verify(true,
				// act.getBillCodeList().stream().anyMatch(x ->
				// x.equals(expect)),
				// "验证验证OrderId[" + expOid + "]订单的期望值[" + expect +
				// "]是否出现在BillCodeList中");
				// }
				// }
				// }
				// Logger.comment("结束验证OrderId[" + expOid + "]订单的BillCodeList");
				Logger.comment("开始验证OrderId[" + expOid + "]订单的BillInfoList");
				DataUtil.verify(exp.getBillInfoList().size(), act
						.getBillInfoList().size(), "验证验证OrderId[" + expOid
						+ "]订单的BillInfoList的size()");
				for (BillInfo expect : exp.getBillInfoList()) {
					String expBid = expect.getBillId();
					boolean flag = act.getBillInfoList().stream()
							.anyMatch(x -> x.getBillId().equals(expBid));
					DataUtil.verify(true, flag, "验证OrderId[" + expOid
							+ "]订单的BillId=[" + expBid + "]是否出现在BillInfoList中");
					if (flag) {
						BillInfo actual = act.getBillInfoList().stream()
								.filter(x -> x.getBillId().equals(expBid))
								.collect(Collectors.toList()).get(0);
						verifyBillInfo(expect, actual, expOid, expBid);
					}
				}
				Logger.comment("开始验证OrderId[" + expOid + "]订单的OrderItemList");
				DataUtil.verify(exp.getOrderItemList().size(), act
						.getOrderItemList().size(), "验证OrderId[" + expOid
						+ "]订单的OrderItemList的size()");
				for (OrderItemInfo expect : exp.getOrderItemList()) {
					String expOrderItemId = expect.getOrderItemId();
					boolean flag = act
							.getOrderItemList()
							.stream()
							.anyMatch(
									x -> x.getOrderItemId().equals(
											expOrderItemId));
					DataUtil.verify(true, flag, "验证OrderId[" + expOid
							+ "]订单的OrderItemId=[" + expOrderItemId
							+ "]是否出现在OrderItemList中");
					if (flag) {
						OrderItemInfo actual = act
								.getOrderItemList()
								.stream()
								.filter(x -> x.getOrderItemId().equals(
										expOrderItemId))
								.collect(Collectors.toList()).get(0);
						verifyOrderItem(expect, actual, expOid, expOrderItemId);
					}
				}
				Logger.comment("结束验证OrderId[" + expOid + "]订单的OrderItemList");

				// Logger.comment("开始验证OrderId[" + expOid +
				// "]订单的OrderSummaryList");
				// if(DataUtil.isNullOrEmpty(exp.getOrderSummaryList())){
				// DataUtil.verify(true,
				// DataUtil.isNullOrEmpty(act.getOrderSummaryList()),
				// "验证OrderId[" + expOid
				// + "]订单的OrderSummaryList==null或者是空列表");
				// }else{
				// boolean orderSummaryListHasValue =
				// DataUtil.isNullOrEmpty(act.getOrderSummaryList()) == false;
				// DataUtil.verify(true, orderSummaryListHasValue, "验证OrderId["
				// + expOid
				// + "]订单的OrderSummaryList!=null且不是空列表");
				// if(orderSummaryListHasValue){
				// DataUtil.verify(exp.getOrderSummaryList().size(),
				// act.getOrderSummaryList().size(), "验证OrderId["
				// + expOid + "]订单的OrderSummaryList的size()");
				// for (OrderSummary expect : exp.getOrderSummaryList()) {
				// boolean flag = act
				// .getOrderSummaryList()
				// .stream()
				// .anyMatch(x -> x.getBillType() == expect.getBillType()
				// && x.getSummary().equals(expect.getSummary()));
				// DataUtil.verify(true, flag, "验证OrderId[" + expOid +
				// "]订单, BillType=[" + expect.getBillType()
				// + "],且Summary=[" + expect.getSummary() +
				// "]存在于OrderSummaryList中");
				// }
				// }
				// }
				// Logger.comment("结束验证OrderId[" + expOid +
				// "]订单的OrderSummaryList");
			}
		}
	}

	/**
	 * 校验砍价团状态
	 * 
	 * */
	private static void verifyBizStaute() {

		GetSellerMainOrderListResponse actualResponse = call
				.getSellerMainOrderListResponse();

		List<OrderInfo> ordeList = actualResponse.getOrderInfoList();

		if (ordeList.size() > 0) {
			for (OrderInfo sellerOrderInfo : ordeList) {

				BizVo biz = Ts_ChangeOrderBizStatus
						.getBizVosByOrderId(sellerOrderInfo.getOrderId());

				if (null == biz)
					continue;
				Logger.verifyEquals(3, biz.getBizStatus(),
						"验证砍价团状态为BizStatus=3");
			}

		}

	}
	private void verifyOrderItem(OrderItemInfo expect, OrderItemInfo actual,
			int expOid, String expOrderItemId) {
		// DataUtil.verify(expect.isSailProtected(), actual.isSailProtected(),
		// "验证OrderId[" + expOid + "]订单的OrderItemId=["
		// + expOrderItemId + "]的SailProtected");
		DataUtil.verifyDecimalEquals(expect.getPrice(), actual.getPrice(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Price");
		DataUtil.verify(expect.getPropertyInfo(), actual.getPropertyInfo(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PropertyInfo");
		DataUtil.verify(expect.getAmount(), actual.getAmount(), "验证OrderId["
				+ expOid + "]订单的OrderItemId=[" + expOrderItemId + "]的Amount");
		DataUtil.verify(expect.getItemType(), actual.getItemType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ItemType");
		DataUtil.verify(expect.getCatalogId(), actual.getCatalogId(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的CatalogId");
		DataUtil.verify(expect.getProductId(), actual.getProductId(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductId");
		DataUtil.verify(expect.getDescription(), actual.getDescription(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Description");
		DataUtil.verify(expect.getOrderItemId(), actual.getOrderItemId(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的OrderItemId");
		DataUtil.verify(expect.getPictureUrl(), actual.getPictureUrl(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PictureUrl");
		DataUtil.verify(expect.getReferenceUrl(), actual.getReferenceUrl(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ReferenceUrl");
		DataUtil.verify(expect.getTitle(), actual.getTitle(), "验证OrderId["
				+ expOid + "]订单的OrderItemId=[" + expOrderItemId + "]的Title");
		DataUtil.verify(expect.getSubProductCategoryId(),
				actual.getSubProductCategoryId(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SubProductCategoryId");
		DataUtil.verify(expect.getLogisticsType(), actual.getLogisticsType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的LogisticsType");
		DataUtil.verify(expect.getStockStatus(), actual.getStockStatus(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的StockStatus");
		DataUtil.verifyDecimalEquals(expect.getPremium(), actual.getPremium(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Premium");
		DataUtil.verify(expect.getSku(), actual.getSku(), "验证OrderId[" + expOid
				+ "]订单的OrderItemId=[" + expOrderItemId + "]的Sku");
		DataUtil.verify(expect.isIsCost(), actual.isIsCost(), "验证OrderId["
				+ expOid + "]订单的OrderItemId=[" + expOrderItemId + "]的IsCost");
		DataUtil.verify(expect.getPriceType(), actual.getPriceType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PriceType");
		DataUtil.verify(expect.getBondedArea(), actual.getBondedArea(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的BondedArea");
		// DataUtil.verify(expect.getProductRefundChannel(),
		// actual.getProductRefundChannel(), "验证OrderId[" + expOid
		// + "]订单的OrderItemId=[" + expOrderItemId + "]的ProductRefundChannel");

		Logger.comment("开始验证OrderId[" + expOid + "]订单的OrderItemId=["
				+ expOrderItemId + "]的OrderItemInfoExt");
		if (expect.getOrderItemInfoExt() == null) {
			DataUtil.verify(expect.getOrderItemInfoExt(),
					actual.getOrderItemInfoExt(), "验证OrderId[" + expOid
							+ "]订单的OrderItemId=[" + expOrderItemId
							+ "]的OrderItemInfoExt对象为null");
		} else {
			DataUtil.verify(expect.getOrderItemInfoExt().getActivityId(),
					actual.getOrderItemInfoExt().getActivityId(), "验证OrderId["
							+ expOid + "]订单的OrderItemId=[" + expOrderItemId
							+ "]的OrderItemInfoExt对象的ActivityId");
			DataUtil.verify(expect.getOrderItemInfoExt()
					.getActivityTemplateId(), actual.getOrderItemInfoExt()
					.getActivityTemplateId(), "验证OrderId[" + expOid
					+ "]订单的OrderItemId=[" + expOrderItemId
					+ "]的OrderItemInfoExt对象的ActivityTemplateId");
			DataUtil.verify(expect.getOrderItemInfoExt().getGiftAvail4Reward(),
					actual.getOrderItemInfoExt().getGiftAvail4Reward(),
					"验证OrderId[" + expOid + "]订单的OrderItemId=["
							+ expOrderItemId
							+ "]的OrderItemInfoExt对象的GiftAvail4Reward");
		}
		Logger.comment("完成验证OrderId[" + expOid + "]订单的OrderItemId=["
				+ expOrderItemId + "]的OrderItemInfoExt");
		DataUtil.verifyDecimalEquals(expect.getSellerCouponAmount(),
				actual.getSellerCouponAmount(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SellerCouponAmount");
		DataUtil.verifyDecimalEquals(expect.getYmtCouponAmount(),
				actual.getYmtCouponAmount(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的YmtCouponAmount");
		DataUtil.verifyDecimalEquals(expect.getDiscount(),
				actual.getDiscount(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId + "]的Discount");
		DataUtil.verifyDecimalEquals(expect.getFreight(), actual.getFreight(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的Freight");
		DataUtil.verifyDecimalEquals(expect.getProductPrice(),
				actual.getProductPrice(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductPrice");
		// DataUtil.verify(expect.getRefundBillNo(), actual.getRefundBillNo(),
		// "验证OrderId[" + expOid + "]订单的OrderItemId=["
		// + expOrderItemId + "]的RefundBillNo");
		DataUtil.verifyDecimalEquals(expect.getProductOriginalPrice(),
				actual.getProductOriginalPrice(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的ProductOriginalPrice");
		DataUtil.verify(expect.getTariffType(), actual.getTariffType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的TariffType");
		DataUtil.verify(expect.getSalesType(), actual.getSalesType(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SalesType");
		// DataUtil.verify(expect.getPromotion(), actual.getPromotion(),
		// "验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
		// + "]的Promotion");
		verifyPromotion(expect.getPromotion(), actual.getPromotion(), expOid,
				expOrderItemId);
		DataUtil.verify(expect.isSupportRtnWithoutReason(),
				actual.isSupportRtnWithoutReason(), "验证OrderId[" + expOid
						+ "]订单的OrderItemId=[" + expOrderItemId
						+ "]的SupportRtnWithoutReason");
		// DataUtil.verify(expect.getFreightFree(), actual.getFreightFree(),
		// "验证OrderId[" + expOid + "]订单的OrderItemId=["
		// + expOrderItemId + "]的FreightFree");
		DataUtil.verify(expect.getStockStatus(), actual.getStockStatus(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的StockStatus");
		DataUtil.verify(expect.isPspProduct(), actual.isPspProduct(),
				"验证OrderId[" + expOid + "]订单的OrderItemId=[" + expOrderItemId
						+ "]的PspProduct");

		verifySubProducts(expOid, actual);
	}

	private void verifyPromotion(ProductPromotion expect,
			ProductPromotion actual, int expOid, String expOrderItemId) {
		if (expect == null) {
			DataUtil.verify(null, actual, "验证OrderId[" + expOid
					+ "]订单的OrderItemId=[" + expOrderItemId
					+ "]的Promotion==null");
		} else {
			DataUtil.verify(expect.getCondition(), actual.getCondition(),
					"验证OrderId[" + expOid + "]订单的OrderItemId=["
							+ expOrderItemId + "]的Promotion.Condition");
			DataUtil.verify(expect.getContent(), actual.getContent(),
					"验证OrderId[" + expOid + "]订单的OrderItemId=["
							+ expOrderItemId + "]的Promotion.Content");
			DataUtil.verify(expect.getID(), actual.getID(), "验证OrderId["
					+ expOid + "]订单的OrderItemId=[" + expOrderItemId
					+ "]的Promotion.ID");
			DataUtil.verify(expect.getName(), actual.getName(), "验证OrderId["
					+ expOid + "]订单的OrderItemId=[" + expOrderItemId
					+ "]的Promotion.Name");
			DataUtil.verify(
					0,
					DataUtil.BigDecimall.compare(
							expect.getPartialReducedAmount(),
							actual.getPartialReducedAmount()),
					"验证OrderId[" + expOid + "]订单的OrderItemId=["
							+ expOrderItemId
							+ "]的Promotion.PartialReducedAmount, 期望值["
							+ expect.getPartialReducedAmount() + "], 实际值["
							+ actual.getPartialReducedAmount() + "]");
			DataUtil.verify(
					0,
					DataUtil.BigDecimall.compare(expect.getReducedAmount(),
							actual.getReducedAmount()),
					"验证OrderId[" + expOid + "]订单的OrderItemId=["
							+ expOrderItemId
							+ "]的Promotion.ReducedAmount, 期望值["
							+ expect.getReducedAmount() + "], 实际值["
							+ actual.getReducedAmount() + "]");
			DataUtil.verify(expect.getType(), actual.getType(), "验证OrderId["
					+ expOid + "]订单的OrderItemId=[" + expOrderItemId
					+ "]的Promotion.Type");
		}
	}

	private void verifyBillInfo(BillInfo expect, BillInfo actual, int expOid,
			String expBid) {
		DataUtil.verify(expect.getAction(), actual.getAction(), "验证验证OrderId["
				+ expOid + "]订单的BillId=[" + expBid + "]的Action");
		DataUtil.verifyDateEquals(expect.getAddTime(), actual.getAddTime(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的AddTime");
		DataUtil.verify(expect.getBillCode(), actual.getBillCode(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的BillCode");
		DataUtil.verifyDecimalEquals(expect.getBillFee(), actual.getBillFee(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的BillFee");
		DataUtil.verify(expect.getBillSupplier(), actual.getBillSupplier(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的BillSupplier");
		DataUtil.verify(expect.getBillUrl(), actual.getBillUrl(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的BillUrl");
		DataUtil.verifyDecimalEquals(expect.getDeclarePrice(),
				actual.getDeclarePrice(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的DeclarePrice");
		DataUtil.verifyDecimalEquals(expect.getDeclareWeight(),
				actual.getDeclareWeight(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的DeclareWeight");
		DataUtil.verify(expect.getDeclineReason(), actual.getDeclineReason(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的DeclineReason");
		DataUtil.verify(expect.getDelReason(), actual.getDelReason(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的DelReason");
		DataUtil.verify(expect.getFromUserId(), actual.getFromUserId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的FromUserId");
		DataUtil.verify(expect.getGoodName(), actual.getGoodName(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的GoodName");
		DataUtil.verify(expect.getIdCardPic(), actual.getIdCardPic(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的IdCardPic");
		DataUtil.verifyDecimalEquals(expect.getInsure(), actual.getInsure(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的Insure");
		DataUtil.verify(expect.getLogisticId(), actual.getLogisticId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的LogisticId");
		DataUtil.verify(expect.getLogisticsStatu(), actual.getLogisticsStatu(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的LogisticsStatu");
		DataUtil.verifyDateEquals(expect.getMatchIdPicTime(),
				actual.getMatchIdPicTime(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的MatchIdPicTime");
		DataUtil.verifyDecimalEquals(expect.getRealWeight(),
				actual.getRealWeight(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的RealWeight");
		DataUtil.verify(expect.getReceiveAddress(), actual.getReceiveAddress(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveAddress");
		DataUtil.verify(expect.getReceiveCity(), actual.getReceiveCity(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveCity");
		DataUtil.verify(expect.getReceiveEmail(), actual.getReceiveEmail(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveEmail");
		DataUtil.verify(expect.getReceiveName(), actual.getReceiveName(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveName");
		DataUtil.verify(expect.getReceivePhone(), actual.getReceivePhone(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceivePhone");
		DataUtil.verify(expect.getReceivePostcode(),
				actual.getReceivePostcode(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceivePostcode");
		DataUtil.verify(expect.getReceiveProvince(),
				actual.getReceiveProvince(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ReceiveProvince");
		DataUtil.verify(expect.getReceiveRegion(), actual.getReceiveRegion(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ReceiveRegion");
		DataUtil.verify(expect.getSenderAddress(), actual.getSenderAddress(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SenderAddress");
		DataUtil.verify(expect.getSenderName(), actual.getSenderName(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SenderName");
		DataUtil.verify(expect.getSenderPhone(), actual.getSenderPhone(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SenderPhone");
		DataUtil.verifyDecimalEquals(expect.getServiceCost(),
				actual.getServiceCost(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的ServiceCost");
		DataUtil.verify(expect.getSignLogisticId(), actual.getSignLogisticId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SignLogisticId");
		DataUtil.verify(expect.getSmallTicket(), actual.getSmallTicket(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的SmallTicket");
		DataUtil.verify(expect.getToUserId(), actual.getToUserId(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的ToUserId");
		DataUtil.verify(expect.getTransferCenter(), actual.getTransferCenter(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的TransferCenter");
		DataUtil.verify(expect.getTransPortNo(), actual.getTransPortNo(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的TransPortNo");
		DataUtil.verify(expect.getTransportServiceType(),
				actual.getTransportServiceType(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的TransportServiceType");
		DataUtil.verify(expect.getTxtChargeStatu(), actual.getTxtChargeStatu(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid
						+ "]的TxtChargeStatu");
		DataUtil.verifyDecimalEquals(expect.getTxtFee(), actual.getTxtFee(),
				"验证验证OrderId[" + expOid + "]订单的BillId=[" + expBid + "]的TxtFee");
		DataUtil.verify(expect.getWeightChargeStatu(),
				actual.getWeightChargeStatu(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的WeightChargeStatu");
		DataUtil.verifyDecimalEquals(expect.getWeightFee(),
				actual.getWeightFee(), "验证验证OrderId[" + expOid + "]订单的BillId=["
						+ expBid + "]的WeightFee");
		DataUtil.verifyDateEquals(expect.getWeightNotifyDateTime(),
				actual.getWeightNotifyDateTime(), "验证验证OrderId[" + expOid
						+ "]订单的BillId=[" + expBid + "]的WeightNotifyDateTime");
	}

	/**
	 * 校验组合商品
	 * @param expectId
	 * @param actProducts
	 */
	private static void verifySubProducts(int orderId, OrderItemInfo actProduct) {

		DefaultWapper data = new DefaultWapper();

		try {

			String catalogId = actProduct.getCatalogId();

			List<SubProductInfo> actualOrderInfoSub = actProduct
					.getSubProductInfos();

			List<OrderInfoSubPo> expectOrderInfoSub = data.getOrderInfoSub(
					orderId, catalogId);

			if (!CollectionUtils.isEmpty(expectOrderInfoSub)) {

				DataUtil.verifyEquals(expectOrderInfoSub.size(),
						actualOrderInfoSub.size(), "验证id=[" + orderId
								+ "]Products 下组合商品记录数");

				boolean flag = expectOrderInfoSub.size() == actualOrderInfoSub
						.size();

				if (flag) {
					Logger.comment("开始验证catalogId=[" + catalogId
							+ "]的Products下的组合商品");

					for (int i = 0; i < expectOrderInfoSub.size(); i++) {

						OrderInfoSubPo expect = expectOrderInfoSub.get(i);
						SubProductInfo actual = actualOrderInfoSub.get(i);

						Logger.verifyEquals(expect.getSubTitle(),
								actual.getSubTitle(), "校验组合商品 subTitle");
						Logger.verifyEquals(expect.getSubCatalogId(),
								actual.getSubCatalogId(), "校验组合商品 subCatalogId");
						Logger.verifyEquals(expect.getFirstCatId(),
								actual.getFirstCatId(), "校验组合商品 firstCatId");

						Logger.verifyEquals(expect.getSecondCatId(),
								actual.getSecondCatId(), "校验组合商品 secondCatId");

						Logger.verifyEquals(expect.getThirdCatId(),
								actual.getThirdCatId(), "校验组合商品 thirdCatId");

						Logger.verifyEquals(expect.getNum(), actual.getNum(),
								"校验组合商品 num");

						DataUtil.verifyDecimalEquals(expect.getOriginalPrice(),
								actual.getOriginalPrice(),
								"校验组合商品 originalPrice");

						DataUtil.verifyDecimalEquals(expect.getPrice(),
								actual.getPrice(), "校验组合商品 price");

						DataUtil.verifyDecimalEquals(expect.getFreight(),
								actual.getFreight(), "校验组合商品 freight");

						DataUtil.verifyDecimalEquals(expect.getDiscount(),
								actual.getDiscount(), "校验组合商品 discount");

						DataUtil.verifyDecimalEquals(expect.getYmtCoupon(),
								actual.getYmtCoupon(), "校验组合商品 ymtCoupon");

						DataUtil.verifyDecimalEquals(expect.getSellerCoupon(),
								actual.getSellerCoupon(), "校验组合商品 sellerCoupon");

						DataUtil.verifyDecimalEquals(
								expect.getThirdPartyDiscount(),
								actual.getThirdPartyDiscount(),
								"校验组合商品 thirdPartyDiscount");

						DataUtil.verifyDecimalEquals(expect.getPromotion(),
								actual.getPromotion(), "校验组合商品 promotion");

					}

				}
			}

		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	private void ConstructExpectedResponse(
			GetSellerMainOrderListResponse response) {
		Process(response);
		//SalesRefundStatus的逻辑有变: 1 > 10 > -10
		changeSalesRefundStatus(response);
	}

	private void changeSalesRefundStatus(GetSellerMainOrderListResponse response) {
		if (!DataUtil.isNullOrEmpty(response.getOrderInfoList())) {
			int[] orderIds = response.getOrderInfoList().stream()
					.mapToInt(x -> x.getOrderId()).toArray();
			Map<Integer, Integer> ordersRefund = new Common()
					.getSalesRefundStatus(orderIds);
			Iterator<Integer> iterator = ordersRefund.keySet().iterator();
			while (iterator.hasNext()) {
				int orderId = iterator.next();
				for (OrderInfo orderInfo : response.getOrderInfoList()) {
					if (orderInfo.getOrderId() == orderId) {
						orderInfo.setSalesRefundStatus(ordersRefund
								.get(orderId));
					}
				}
			}
		}
	}

	private void Process(GetSellerMainOrderListResponse response) {
		SellerMainOrderListQueryModel model = RequestCovertor
				.SellerMainOrderListRequestArguments(request);
		SellerMainOrderListResponseProcessor(model, response);
	}

	private void SellerMainOrderListResponseProcessor(
			SellerMainOrderListQueryModel model,
			GetSellerMainOrderListResponse response) {
		Sp_GetSellerOrderList_v2 sp = new Sp_GetSellerOrderList_v2();
		sp.setSellerId(model.getSellerId());
		sp.setOrderType(model.getOrderType());
		sp.setShangou(model.getShangou());
		sp.setOrderStatus(model.getOrderStatus());
		sp.setCatalogStatus(model.getCatalogStatus());
		sp.setAddBeginTime(model.getAddBeginTime());
		sp.setAddEndTime(model.getAddEndTime());
		sp.setPaidBeginTime(model.getPaidBeginTime());
		sp.setPaidEndTime(model.getPaidEndTime());
		sp.setProductId(model.getProductId());
		sp.setReceiverName(model.getReceiverName());
		sp.setReceiverPhone(model.getReceiverPhone());
		sp.setRowFrom(model.getPagination().getPageItemIndexFrom());
		sp.setRowTo(model.getPagination().getPageItemIndexTo());
		sp.setBuyerNickName(model.getBuyerNickName());
		sp.setProductName(model.getProductName());
		sp.setSalesRefundOrderOnly(model.isSalesRefundOrderOnly());
		sp.setDomesticDelivered(model.getDomesticDelivered());
		sp.setMainOrderId(model.getMainOrderId());
		sp.setOrderId(model.getOrderId());
		sp.setRemarkLevel(model.getRemarkLevel());
		sp.setDeliveryCode(model.getDeliveryCode());

		Sp_GetSellerOrdersByOrderIds_v1 result = sp.execute();

		OrderEntities orderResult = ConvertResult(result.getTotalCount(),
				result.getOrderList(), result.getCreditDetailList(),
				result.getOrderNoteList(), result.getOrderStateList(),
				result.getPostPayList(), result.getOrderInfoList(),
				result.getOrderSummarieList(), result.getOrderFrozenList(),
				result.getOrderToBillList(), result.getBillList(),
				result.getTradingItemList(), result.getOrderExtList());
		List<com.ymatou.query.seller.trading.api.parameter.OrderInfo> orderInfoList = OrderConverter
				.AsOrderInfos(orderResult, true);
		response.setOrderInfoList(orderInfoList);
		response.setAllRecordCount(orderResult.getTotalCount());
	}

	@SuppressWarnings("rawtypes")
	private OrderEntities ConvertResult(int totalCount, List<Map> OrderList,
			List<Map> CreditDetailList, List<Map> OrderNoteList,
			List<Map> OrderStateList, List<Map> PostPayList,
			List<Map> OrderInfoList, List<Map> OrderSummarieList,
			List<Map> OrderFrozenList, List<Map> OrderToBillList,
			List<Map> BillList, List<OrderTradingId> TradingItemList,
			List<Map> OrderExtList) {
		OrderEntities entity = new OrderEntities();
		List<Ymt_Order> Orders = new ArrayList<Ymt_Order>();
		List<Ymt_CreditDetail> CreditDetails = new ArrayList<Ymt_CreditDetail>();
		List<Ymt_O_OrderNote> OrderNotes = new ArrayList<Ymt_O_OrderNote>();
		List<Ymt_OrderState> OrderStates = new ArrayList<Ymt_OrderState>();
		List<Ymt_OrderPostPay> PostPays = new ArrayList<Ymt_OrderPostPay>();
		List<Ymt_OrderInfo> OrderInfos = new ArrayList<Ymt_OrderInfo>();
		List<Ymt_OrderSummary> OrderSummaries = new ArrayList<Ymt_OrderSummary>();
		List<Ymt_Order_Frozen> OrderFrozens = new ArrayList<Ymt_Order_Frozen>();
		List<Ymt_OrderToBill> OrderToBills = new ArrayList<Ymt_OrderToBill>();
		List<Ymt_Bill> Bills = new ArrayList<Ymt_Bill>();
		List<Ymt_TradingItem> TradingItems = new ArrayList<Ymt_TradingItem>();
		List<Ymt_OrderExt> OrderExts = new ArrayList<Ymt_OrderExt>();
		entity.setTotalCount(totalCount);
		if (DataUtil.isNullOrEmpty(OrderList) == false) {
			for (Map m : OrderList) {
				Ymt_Order o = new Ymt_Order();
				DataUtil.mapToBean(o, m);
				Orders.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(CreditDetailList) == false) {
			for (Map m : CreditDetailList) {
				Ymt_CreditDetail o = new Ymt_CreditDetail();
				DataUtil.mapToBean(o, m);
				CreditDetails.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(OrderNoteList) == false) {
			for (Map m : OrderNoteList) {
				Ymt_O_OrderNote o = new Ymt_O_OrderNote();
				DataUtil.mapToBean(o, m);
				OrderNotes.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(OrderStateList) == false) {
			for (Map m : OrderStateList) {
				Ymt_OrderState o = new Ymt_OrderState();
				DataUtil.mapToBean(o, m);
				OrderStates.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(PostPayList) == false) {
			for (Map m : PostPayList) {
				Ymt_OrderPostPay o = new Ymt_OrderPostPay();
				DataUtil.mapToBean(o, m);
				PostPays.add(o);
			}
		}
		if (DataUtil.isNullOrEmpty(OrderInfoList) == false) {
			for (Map m : OrderInfoList) {
				Ymt_OrderInfo o = new Ymt_OrderInfo();
				DataUtil.mapToBean(o, m);
				OrderInfos.add(o);
			}
			if (DataUtil.isNullOrEmpty(OrderSummarieList) == false) {
				for (Map m : OrderSummarieList) {
					Ymt_OrderSummary o = new Ymt_OrderSummary();
					DataUtil.mapToBean(o, m);
					OrderSummaries.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(OrderFrozenList) == false) {
				for (Map m : OrderFrozenList) {
					Ymt_Order_Frozen o = new Ymt_Order_Frozen();
					DataUtil.mapToBean(o, m);
					OrderFrozens.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(OrderToBillList) == false) {
				for (Map m : OrderToBillList) {
					Ymt_OrderToBill o = new Ymt_OrderToBill();
					DataUtil.mapToBean(o, m);
					OrderToBills.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(BillList) == false) {
				for (Map m : BillList) {
					Ymt_Bill o = new Ymt_Bill();
					DataUtil.mapToBean(o, m);
					Bills.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(TradingItemList) == false) {
				for (OrderTradingId m : TradingItemList) {
					Ymt_TradingItem o = new Ymt_TradingItem();
					o.setiOrderId(m.getiOrderId());
					o.setiTradingId(m.getiTradingId());
					o.setdAddTime(m.getVirtualTime());
					TradingItems.add(o);
				}
			}
			if (DataUtil.isNullOrEmpty(OrderExtList) == false) {
				for (Map m : OrderExtList) {
					Ymt_OrderExt o = new Ymt_OrderExt();
					DataUtil.mapToBean(o, m);
					OrderExts.add(o);
				}
			}
		}
		entity.setCreditDetails(CreditDetails);
		entity.setOrderExts(OrderExts);
		entity.setOrderFrozens(OrderFrozens);
		entity.setOrderInfos(OrderInfos);
		entity.setOrderNotes(OrderNotes);
		entity.setOrders(Orders);
		entity.setOrderStates(OrderStates);
		entity.setOrderSummaries(OrderSummaries);
		entity.setOrderToBills(OrderToBills);
		entity.setPostPays(PostPays);
		entity.setTotalCount(totalCount);
		entity.setTradingItems(TradingItems);
		entity.setBills(Bills);
		return entity;
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_001() {
		Logger.start(true, "商家后台订单列表, 传入大量的请求参数, mssql查询");
		String addBeginTime = YMTDateUtil.getBeforeOrNextDay(-60,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMD)
				+ "T00:00:00";
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		Logger.comment("准备订单数据");
		OrderCreate o = new OrderCreate();
		C2COrderInfo order = o.create1_M2cOrder(userId, sellerId);
		Logger.comment("完成准备订单数据");
		try {
			SyncVerifyService.getSyncResult(order.getiOrderId());

			int pageNum = 1;
			int pageSize = 3;
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setMainOrderId(order.getiMainOrderId());
			request.setOrderId(order.getiOrderId());
			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_002() {
		Logger.start(true, "商家后台订单列表, 只传sellerId,pageNum,pageSize");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int pageNum = 1;
		int pageSize = 3;
		try {
			String addBeginTime = YMTDateUtil.getBeforeOrNextDay(-60,
					YMTDateUtil.YMD) + "T00:00:00";
			String addEndTime = YMTDateUtil.getBeforeOrNextDay(-30,
					YMTDateUtil.YMD) + "T00:00:00";
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_006() {
		Logger.start(true, "商家后台订单列表, buyerNickName过滤(es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		String buyerNickName = String.valueOf(EnvSetup.getData("BuyUserName"));
		int pageNum = 1;
		int pageSize = 3;
		String addBeginTime = YMTDateUtil.getBeforeOrNextDay(-30,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextDay(0, YMTDateUtil.YMD)
				+ "T00:00:00";
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setBuyerNickName(buyerNickName);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	@Ignore
	public void Tc_GetSellerMainOrderList_007() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(已付款)过滤");
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));

		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_008() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(订单确立)过滤");
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_009() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(订单补款完成, 等待发货)过滤");
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_010() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(已确认接单,等待发起补款)过滤");
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.SellerAccept.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_011() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(确认收货)过滤");
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.Received.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_013() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 订单状态(已发货)过滤");
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.Shipped.getValue());
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
					YMTDateUtil.YMD) + "T00:00:00";
			String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
					YMTDateUtil.YMD) + "T00:00:00";
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_014() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据订单过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		int orderId = new OrderCreate().create1_M2cOrder(userId, sellerId)
				.getiOrderId();
		try {
			Thread.sleep(2000l);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setOrderId(orderId);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_015() {
		Logger.start(true, "商家后台订单列表, 根据主订单过滤");

		int pageNum = 1;
		int pageSize = 3;
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		int mainOrderId = new OrderCreate().create1_M2cOrder(userId, sellerId)
				.getiMainOrderId();
		try {
			Thread.sleep(2000l);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setMainOrderId(mainOrderId);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_016() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = null;
			String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
					YMTDateUtil.YMD) + "T00:00:00";
			String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
					YMTDateUtil.YMD) + "T00:00:00";
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setRemarkLevel(remarkLevel);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_017() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表, 根据购买时间过滤");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
					YMTDateUtil.YMD) + "T00:00:00";
			String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
					YMTDateUtil.YMD) + "T00:00:00";
			String paidBeginTime = YMTDateUtil.getBeforeOrNextHour(-45,
					YMTDateUtil.YMD) + "T00:00:00";
			String paidEndTime = YMTDateUtil.getBeforeOrNextHour(-25,
					YMTDateUtil.YMD) + "T00:00:00";
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPaidBeginTime(paidBeginTime);
			request.setPaidEndTime(paidEndTime);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();

			if (call.getAllRecordCount() > pageSize * 5) {
				int maxPageNum = (int) Math.ceil(call.getAllRecordCount()
						/ pageSize);
				pageNum = DataUtil.Random.getRandomIntFromRange(3, maxPageNum);
				Logger.comment("随机取一页数据，页号：" + pageNum);
				request.setCurrentPageNum(pageNum);
				call.setData(request);
				call.callService();
				verify();
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_019() {
		int pageNum = 1;
		int pageSize = 3;
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			Integer remarkLevel = 0;
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setSellerId(sellerId);
			request.setRemarkLevel(remarkLevel);
			request.setCurrentPageNum(pageNum);
			request.setPageSize(pageSize);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_020() {
		int pageNum = 1;
		int pageSize = 3;
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setRemarkLevel(1);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_021() {
		int pageNum = 1;
		int pageSize = 3;
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setRemarkLevel(2);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_022() {
		int pageNum = 1;
		int pageSize = 3;
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		try {
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setRemarkLevel(3);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	// @Ignore
	public void Tc_GetSellerMainOrderList_023() {
		int pageNum = 1;
		int pageSize = 3;
		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-50,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(-20,
				YMTDateUtil.YMD) + "T00:00:00";
		Logger.start(true, "商家后台订单列表, 根据remarkLevel过滤");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setRemarkLevel(3);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_024() throws Exception {
		Logger.start(true, "商家后台订单列表, 第一页第一条");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int pageNum = 1;
		int pageSize = 1;
		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_025() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "商家后台订单列表查询成功, 测试productname筛选(走es)");
		try {
			int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
			String paidBeginTime = YMTDateUtil.getBeforeOrNextHour(0,
					YMTDateUtil.YMD) + "T00:00:00";
			String paidEndTime = YMTDateUtil.getBeforeOrNextHour(0,
					YMTDateUtil.YMD) + "T00:00:00";
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setPaidBeginTime(paidBeginTime);
			request.setPaidEndTime(paidEndTime);
			request.setProductName("童装");
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_026() throws Exception {
		Logger.start(true, "商家后台订单列表查询成功, 验证productId筛选(走es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			String productId = o.create1_M2cOrder(userId, sellerId)
					.getsProductId();
			Thread.sleep(2000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setCurrentPageNum(1);
			request.setProductId(productId);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_027() throws Exception {
		Logger.start(true, "商家后台订单列表查询成功, 验证receiverName筛选(走es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			String receiverName = o.create1_M2cOrder(userId, sellerId)
					.getsReceivePerson();
			Thread.sleep(2000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setCurrentPageNum(1);
			request.setReceiverName(receiverName);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_028() throws Exception {
		Logger.start(true, "商家后台订单列表查询成功, 验证receiverPhone筛选(走es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			String receiverPhone = o.create1_M2cOrder(userId, sellerId)
					.getsPhone();
			Thread.sleep(5000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setCurrentPageNum(1);
			request.setReceiverPhone(receiverPhone);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_029() throws Exception {
		Logger.start(true, "商家后台订单列表查询失败, 验证productId筛选(走es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			String productId = o.create1_M2cOrder(userId, sellerId)
					.getsProductId();
			Thread.sleep(2000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setCurrentPageNum(1);
			request.setProductId(productId + "404");
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_030() throws Exception {
		Logger.start(true, "商家后台订单列表查询失败, 验证receiverName筛选(走es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			String receiverName = o.create1_M2cOrder(userId, sellerId)
					.getsReceivePerson();
			Thread.sleep(2000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setCurrentPageNum(1);
			request.setReceiverName(receiverName + "404");
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P2.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_031() throws Exception {
		Logger.start(true, "商家后台订单列表查询成功, 验证receiverPhone筛选(走es)");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			String receiverPhone = o.create1_M2cOrder(userId, sellerId)
					.getsPhone();
			Thread.sleep(2000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setCurrentPageNum(1);
			request.setReceiverPhone(receiverPhone + "404");
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_032() throws Exception {
		Logger.start(true, "商家后台订单列表查询失败, 查询其他买手且同一买家的订单");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		int sellerId2 = Integer.valueOf(EnvSetup.getData("SellerId2"));
		int userId = Integer.valueOf(EnvSetup.getData("BuyUserId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(0,
					YMTDateUtil.YMD) + "T00:00:00");
			Logger.comment("准备测试数据");
			OrderCreate o = new OrderCreate();
			Integer o1 = o.create1_M2cOrder(userId, sellerId).getiOrderId();
			Integer o2 = o.create1_M2cOrder(userId, sellerId2).getiOrderId();
			Thread.sleep(2000l);
			Logger.comment("完成准备测试数据");
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(1);
			request.setOrderId(o2);
			request.setCurrentPageNum(1);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_033() throws Exception {
		Logger.start(true, "商家后台订单列表查询成功,查询国内未发货的订单");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(-180,
					YMTDateUtil.YMD) + "T00:00:00");
			PackageDeliveryDomesticStatusFilter filter = new PackageDeliveryDomesticStatusFilter();
			//国内未发货
			filter.setDomesticUndelivered(true);
			request.setPackageDeliveryDomesticStatusFilter(filter);
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(100);
			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(1);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_034() {
		Logger.start(true, "商家后台订单列表查询成功,查询国内已发货的订单");
		int sellerId = Integer.valueOf(EnvSetup.getData("SellerId"));
		try {
			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(-180,
					YMTDateUtil.YMD) + "T00:00:00");
			PackageDeliveryDomesticStatusFilter filter = new PackageDeliveryDomesticStatusFilter();
			//国内已发货
			filter.setDomesticDelivered(true);
			request.setPackageDeliveryDomesticStatusFilter(filter);
			request.setSellerId(sellerId);
			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");
			request.setPageSize(100);

			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(1);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");
			verify();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_035() {
		int pageNum = 1;
		int pageSize = 3;

		Logger.start(true, "砍价团订单,组团成功，商家后台订单列表查询成功");

		PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

		int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
		// 砍价团id
		String bizId = placeOrderResp.getBizId();
		// 开团订单
		Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

		// 砍价团参团订单
		PlaceOrderResp placeOrderResp2 = BargainGroupService.joinGroup(bizId);
		// 参团
		Integer orderId2 = placeOrderResp2.getOrderList().get(0).getOrderId();

		BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, 3);

		SyncVerifyService.getSyncResult(orderId);

		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-5,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(1, YMTDateUtil.YMD)
				+ "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());

		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

			verifyBizStaute();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_036() {
		int pageNum = 1;
		int pageSize = 3;

		Logger.start(true, "砍价团订单,组团失败,获取商家订单列表成功,砍价团订单未组团成功之前不展示");

		PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

		int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
		// 砍价团id
		String bizId = placeOrderResp.getBizId();
		// 开团订单
		Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

		// 砍价团参团订单
		PlaceOrderResp placeOrderResp2 = BargainGroupService.joinGroup(bizId);
		// 参团
		Integer orderId2 = placeOrderResp2.getOrderList().get(0).getOrderId();

		BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, -3);

		SyncVerifyService.getSyncResult(orderId);

		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-5,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(1, YMTDateUtil.YMD)
				+ "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());

		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

			verifyBizStaute();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_037() {
		int pageNum = 1;
		int pageSize = 3;

		Logger.start(true, "砍价团订单,组团失败,获取商家订单列表成功,砍价团订单未组团成功之前不展示");

		PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

		int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
		// 砍价团id
		String bizId = placeOrderResp.getBizId();
		// 开团订单
		Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

		// 砍价团参团订单
		PlaceOrderResp placeOrderResp2 = BargainGroupService.joinGroup(bizId);
		// 参团
		Integer orderId2 = placeOrderResp2.getOrderList().get(0).getOrderId();

		BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, 0);

		SyncVerifyService.getSyncResult(orderId);

		String addBeginTime = YMTDateUtil.getBeforeOrNextHour(-5,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextHour(1, YMTDateUtil.YMD)
				+ "T00:00:00";
		List<Integer> orderStatusList = new ArrayList<Integer>();
		orderStatusList.add(OrderStatusEnum.AccountPaid.getValue());

		try {
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

			verifyBizStaute();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_038() {
		int pageNum = 1;
		int pageSize = 3;
		Logger.start(true, "砍价团订单,组团成功。商家后台订单列表查询成功, 测试productname筛选(走es)");
		try {
			PlaceOrderResp placeOrderResp = BargainGroupService.openGroup(null);

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			// 砍价团id
			String bizId = placeOrderResp.getBizId();
			// 开团订单
			Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			// 砍价团参团订单
			PlaceOrderResp placeOrderResp2 = BargainGroupService
					.joinGroup(bizId);
			// 参团
			Integer orderId2 = placeOrderResp2.getOrderList().get(0)
					.getOrderId();

			BargainGroupService.notifyOrderBizStatus(bizId, orderId, 1, 3);

			SyncVerifyService.getSyncResult(orderId);

			String addBeginTime = YMTDateUtil.getBeforeOrNextDay(-5,
					YMTDateUtil.YMD) + "T00:00:00";
			String addEndTime = YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00";

			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setProductName("砍价团");
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();
			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

			verifyBizStaute();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_039() {
		Logger.start(true, "商家后台订单列表查询成功,根据物流单号查询订单");
		try {
			PlaceOrderResp placeOrderResp = PlaceOrderService
					.placeOrderWithOutCoupon();

			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int userId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();

			Logger.comment("前置数据准备结束");

			OrderCallService orderCallService = new OrderCallService();
			// 应付款全金额 
			BigDecimal totalPrice = orderCallService
					.getNeedPrePayAmountOfCashBymainOrderId(tradingId);
			// 支付订单
			orderCallService.orderPayRequest(userId, totalPrice, tradingId);

			// 接单
			orderCallService.acceptOrder(orderId, sellerId);

			// 保存物流信息
			String billCode = SyncVerifyService.dispatched(orderId, sellerId);

			// 同步国内发货信息
			YmatouEasyCall YmatouEasyCall = new YmatouEasyCall("", "POST",
					"JSON");

			String orderJson = "{\"logisticsNos\":[\"" + billCode + "\"]}";

			YmatouEasyCall
					.setUrl("http://operate.trading.iapi.ymatou.com/api/Notify/SyncOrderLogisticStatus");
			YmatouEasyCall.setData(orderJson);
			YmatouEasyCall.callService();

			SyncVerifyService.getSyncResult(orderId);

			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(-1,
					YMTDateUtil.YMD) + "T00:00:00");

			PackageDeliveryDomesticStatusFilter filter = new PackageDeliveryDomesticStatusFilter();

			//国内已发货
			filter.setDomesticDelivered(true);
			//request.setPackageDeliveryDomesticStatusFilter(filter);

			request.setSellerId(sellerId);

			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");

			request.setPageSize(10);

			request.setDeliveryCode(billCode);

			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(1);
			call.setData(request);
			call.callService();

			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_040() {
		Logger.start(true, "商家后台订单列表查询成功,根据商品名称,物流单号查询订单");
		try {
			PlaceOrderResp placeOrderResp = PlaceOrderService
					.placeOrderWithOutCoupon();

			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int userId = placeOrderResp.getUserId();
			int tradingId = placeOrderResp.getTradingId();

			Logger.comment("前置数据准备结束");

			OrderCallService orderCallService = new OrderCallService();
			// 应付款全金额 
			BigDecimal totalPrice = orderCallService
					.getNeedPrePayAmountOfCashBymainOrderId(tradingId);
			// 支付订单
			orderCallService.orderPayRequest(userId, totalPrice, tradingId);

			// 接单
			orderCallService.acceptOrder(orderId, sellerId);

			// 保存物流信息
			String billCode = SyncVerifyService.dispatched(orderId, sellerId);

			// 同步国内发货信息
			YmatouEasyCall YmatouEasyCall = new YmatouEasyCall("", "POST",
					"JSON");

			String orderJson = "{\"logisticsNos\":[\"" + billCode + "\"]}";

			YmatouEasyCall
					.setUrl("http://operate.trading.iapi.ymatou.com/api/Notify/SyncOrderLogisticStatus");
			YmatouEasyCall.setData(orderJson);
			YmatouEasyCall.callService();

			SyncVerifyService.getSyncResult(orderId);

			request.setAddBeginTime(YMTDateUtil.getBeforeOrNextDay(-1,
					YMTDateUtil.YMD) + "T00:00:00");

			PackageDeliveryDomesticStatusFilter filter = new PackageDeliveryDomesticStatusFilter();

			//国内已发货
			filter.setDomesticDelivered(true);
			//request.setPackageDeliveryDomesticStatusFilter(filter);

			request.setProductName("自动化");

			request.setSellerId(sellerId);

			request.setAddEndTime(YMTDateUtil.getBeforeOrNextDay(1,
					YMTDateUtil.YMD) + "T00:00:00");

			request.setPageSize(10);

			request.setDeliveryCode(billCode);

			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.Shipped.getValue());
			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(1);
			call.setData(request);
			call.callService();

			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetSellerMainOrderList_041() {

		Logger.start(true, "订单含有组合商品,商家后台订单列表");

		String addBeginTime = YMTDateUtil.getBeforeOrNextDay(-2,
				YMTDateUtil.YMD) + "T00:00:00";
		String addEndTime = YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMD)
				+ "T00:00:00";

		PlaceOrderResp placeOrderResp = PlaceOrderService.placeOrder10();

		int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

		Integer orderId = placeOrderResp.getOrderList().get(0).getOrderId();

		SyncVerifyService.getSyncResult(orderId);

		Logger.comment("完成准备订单数据");
		try {

			int pageNum = 1;
			int pageSize = 10;
			request.setAddBeginTime(addBeginTime);
			request.setAddEndTime(addEndTime);
			request.setPageSize(pageSize);
			request.setSellerId(sellerId);
			request.setMainOrderId(placeOrderResp.getMainOrderId());
			request.setOrderId(orderId);

			List<Integer> orderStatusList = new ArrayList<Integer>();
			orderStatusList.add(OrderStatusEnum.OrderEstablish.getValue());

			request.setOrderStatusList(orderStatusList);
			request.setCurrentPageNum(pageNum);
			call.setData(request);
			call.callService();

			//Logger.info("return data:" + call.getReturnData());

			Logger.verifyEquals("200", call.getCode(), "验证code");

			verify();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}